package com.zyy.joseata.mq;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.amqp.rabbit.listener.RabbitListenerEndpoint;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;

@NoArgsConstructor
@AllArgsConstructor
public class JoSeataRabbitListenerContainerFactory extends SimpleRabbitListenerContainerFactory {

    private JoSeataRabbitListenerMessageProcess afterReceiveMessagePostProcessor;

    @Override
    protected void initializeContainer(SimpleMessageListenerContainer instance,
                                       RabbitListenerEndpoint endpoint) {
        super.initializeContainer(instance, endpoint);
        instance.addAfterReceivePostProcessors(afterReceiveMessagePostProcessor);
    }

}
